{{include file=Yaf\Application::app()->getConfig()->user->header_html}}
</head>
<body>

<div class="ok-body">
	<ul class="layui-tab-title">
		<li class="">
			<a href="/admin/Setting/edit_wechat_xcx">小程序设置</a>
		</li>
		<li class="layui-this">
			<a href="/admin/Setting/edit_wechat_gzh">公众号设置</a>
		</li>
	</ul>
	<!--form表单-->
	<div class="layui-tab-content" style="height: 100px;">
		<div class="layui-tab-item layui-show">
			<form class="layui-form ok-form" lay-filter="filter">
				<div class="layui-form-item">
					<label class="layui-form-label">名称</label>
					<div class="layui-input-block">
						<input type="text" name="app_name" placeholder="请输入名称" autocomplete="off" class="layui-input"
							   lay-verify="" value="{{$wxapp['app_name']}}">
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">appid</label>
					<div class="layui-input-block">
						<input type="text" name="app_id" placeholder="请输入appid" autocomplete="off" class="layui-input"
							   lay-verify="" value="{{$wxapp['app_id']}}">
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">app_secret</label>
					<div class="layui-input-block">
						<input type="text" name="app_secret" placeholder="请输入app_secret" autocomplete="off" class="layui-input"
							   lay-verify="" value="{{$wxapp['app_secret']}}">
					</div>
				</div>


				<div class="layui-form-item">
					<div class="layui-input-block">
						<button class="layui-btn" lay-submit lay-filter="edit">立即提交</button>
						<button type="reset" class="layui-btn layui-btn-primary">重置</button>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>


<script src="{{__STATIC__}}/lib/layui/layui.js"></script>
<script>


	layui.use(["element", "form", "okLayer", "okUtils"], function () {
		let form = layui.form;
		let okLayer = layui.okLayer;
		let okUtils = layui.okUtils;
		okLoading.close();


		form.on("submit(edit)", function (data) {
			okUtils.ajax("/admin/setting/edit_wechat_gzh", "post", data.field, true).done(function (response) {
				console.log(response);
				okLayer.greenTickMsg(response.msg, function () {

				});
			}).fail(function (error) {
				console.log(error)
			});
			return false;
		});
	})
</script>

</body>

</html>